<template>
  <div class="ad-form">
    <el-form size="mini" inline label-position="right" label-width="auto" ref="form" :model="form" v-loading="loading" :disabled="isDisableForm">
      <div class="ad-block">
        <el-form-item label="网点名称："prop="name" :rules="[{required: true, message: '请输入'}]">
          <el-input v-model="form.name" placeholder="请输入"/>
        </el-form-item>
<!--        <el-row :gutter="14">-->
<!--          <el-col :span="12">-->
<!--            <el-form-item label="联系人员："prop="linkman" :rules="[{required: true, message: '请输入'}]">-->
<!--              <el-input v-model="form.linkman" placeholder="请输入"/>-->
<!--            </el-form-item>-->
<!--          </el-col>-->
<!--          <el-col :span="12">-->
<!--            <el-form-item label="联系电话："prop="phone" :rules="[{required: true, message: '请输入'}]">-->
<!--              <ad-input-number v-model="form.phone" placeholder="请输入"/>-->
<!--            </el-form-item>-->
<!--          </el-col>-->
<!--        </el-row>-->
        <el-form-item label="地址："prop="address" :rules="[{required: true, message: '请输入'}]">
          <el-input v-model="form.address" placeholder="请输入"/>
        </el-form-item>
        <el-form-item label="所在城市：" prop="regionCode" :rules="[{required: true, message: '请输入'}]">
          <ad-city-select v-model="form.regionCode"/>
        </el-form-item>
        <el-form-item label="服务城市：" prop="chargeCodeList" :rules="[{required: true, message: '请输入'}]">
          <ad-city-multi-select v-model="form.chargeCodeList" :cityData="cityData" :rules="[{required: true, message: '请输入'}]"/>
        </el-form-item>
      </div>
    </el-form>
    <div class="op">
      <el-button type="primary" :loading="saving" @click="save">保 存</el-button>
      <el-button type="primary" plain @click="cancel">取 消</el-button>
    </div>
  </div>
</template>

<script>
import AdInputNumber from '@/components/AdInputNumber'
import AdCitySelect from '@/components/AdCitySelect'
import AdCityMultiSelect from '@/components/AdCityMultiSelect'
import adForm from '@/mixins/adForm'
import { getLevelList } from '@/api/city/provinceCity'
import { add, edit, get } from '@/api/site'

class Form {

}

export default {
  components: { AdInputNumber, AdCitySelect, AdCityMultiSelect },
  mixins: [adForm({get, add, edit})],
  data() {
    return {
      cityData: [],
      form: new Form()
    }
  },
  created() {
    getLevelList().then(res => this.cityData = res.data)
  }
}
</script>

<style scoped>

</style>